package com.zhuang.thread.blocked;

public class B extends Thread {

	private Object obj;

	public B(String name, Object obj) {
		super(name);
		this.obj = obj;
	}

	@Override
	public void run() {
		synchronized (obj) {
			System.out.println("线程B开始执行");
			System.out.println("线程B开始真正执行代码");
			long beginTime = System.currentTimeMillis();
			while (System.currentTimeMillis() - beginTime < 5000) {

			}
			System.out.println("线程B执行完毕");
		}
	}
}
